package com.attilax.util;

import java.io.File;
import java.io.FilenameFilter;
import java.util.List;

import javax.swing.filechooser.FileNameExtensionFilter;

import com.attilax.io.filex;
import com.attilax.io.pathx;
import com.attilax.rails.foreachProcessor;

public class MoveDelDupliZipRarFile {
	
 public static void main(String[] args) {
		String dir="D:\\ati wechat video\\mp4";
		File[] fs=new File(dir).listFiles( new   FilenameFilter(){

			@Override
			public boolean accept(File arg0, String arg1) {
				 if( arg1.toLowerCase().endsWith(".mp4"))
				return true;
				return false;
			}} );
		for (File f : fs) {
		//	filex.getFileName_mainname_noExtName_nopath(fileName)
			String mainname=pathx.getFileName_mainname_noExtName_nopath(f.getAbsolutePath());
			List<File> zips=getZips(mainname);
		}
		
}

private static List<File> getZips(String dir,String mainname) {
	File[] fs=new File(dir).listFiles( new   FilenameFilter(){

		@Override
		public boolean accept(File arg0, String arg1) {
			 if( arg1.toLowerCase().startsWith(arg1) && arg1.toLowerCase().endsWith(".zip")  )
			return true;
			 if( arg1.toLowerCase().startsWith(arg1) && arg1.toLowerCase().endsWith(".rar")  )
					return true;
			return false;
		}} );
	return null;
}
	
//	private static final Object OBJECT = new FileNameExtensionFilter(dst, ext){};

     

}
